package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.Map;

@Mapper
public interface UserMapper {

    /**
     * 通过openid查询用户
     * @param openid
     * @return
     */
    @Select("select * from sky_take_out.user where openid = #{openid}")
    User getUserByOpenid(String openid);


    /**
     * 新增用户，即自动注册用户
     * @param user
     */
    void insert(User user);


    /**
     * 查询全部用户
     * @param map
     * @return
     */
    Integer countMap(Map map);
}
